Calculates time series of partitioned areas by major basin


In [1]:
%pylab notebook
import csv
import datetime as dt
import glob
import matplotlib.pyplot as plt
import matplotlib.dates as md
from nose.tools import set_trace
from charistools.convertors import Dem2Hypsometry
from charistools.hypsometry import Hypsometry
from charistools.meltModels import TriSurfTempIndexMelt
from charistools.meltModels import ImshowTriSurfMelt
from charistools.meltModels import PlotTriSurfInput
from charistools.meltModels import PlotTriSurfMelt
from charistools.modelEnv import ModelEnv
from charistools.timeSeries import TimeSeries
import pandas as pd
import re
import os


/Users/brodzik/.conda/envs/charis/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
Populating the interactive namespace from numpy and matplotlib

In [14]:
snowyConfigFile = '/Users/brodzik/ipython_notebooks/charis/snowy_basins_modelEnv_config.ini'
snowyBasinEnv = ModelEnv(tileConfigFile=snowyConfigFile)

In [4]:
#snowyBasinEnv.tileConfig

In [5]:
# ids = ['AM', 'BR', 'GA_v01', 'IN_v01', 'SY_v01']
ids = ['AM']

In [6]:
# Generate a list of all OBJECTID basins
def objectIDs(id):
    %cd /Users/brodzik/projects/CHARIS/derived_hypsometries/MODSCAG_GF_v09_fromFile_rainv01_less_ET/
    objectIDs = []
    ids = glob.glob("%s_OBJECTID*" % id)
    ids.sort()
    print("There are %d OBJECTID sub-basins for the %s major basin" % (len(ids), id))
    return(ids)

In [22]:
years = np.arange(1) + 2001
years


Out[22]:
array([2001])

In [27]:
for year in years:
    for i, id in enumerate(ids):
        
        # Get a list of the snowy_basins for this id
        # Read each area file for each objectID in turn, and sub-total by doy
        objects = objectIDs(id)
        #objects = objects[:2]
        print("subbasins for this major basin:")
        print(objects)
        partition_types = ['snow_on_land', 'exposed_glacier_ice', 'snow_on_ice']
        sol = pd.DataFrame()
        soi = pd.DataFrame()
        egi = pd.DataFrame()
        for object in objects:
            print("Next objectID: %s" % object)
            SOLFile = snowyBasinEnv.hypsometry_filename(
                type='snow_on_land_melt_by_elevation',
                drainageID=object,
                year=year,
                modice_nstrikes=3)
            SOIFile = snowyBasinEnv.hypsometry_filename(
                type='snow_on_ice_melt_by_elevation',
                drainageID=object,
                year=year,
                modice_nstrikes=3,
                threshold='fromFile',
                ablation_method='grsize_scag')
            EGIFile = snowyBasinEnv.hypsometry_filename(
                type='exposed_glacier_ice_melt_by_elevation',
                drainageID=object,
                year=year,
                modice_nstrikes=3,
                threshold='fromFile',
                ablation_method='grsize_scag')
            
            solHyps = Hypsometry(SOLFile)
            soiHyps = Hypsometry(SOIFile)
            egiHyps = Hypsometry(EGIFile)
            
            # If SOLmelt is non-empty, but SOImelt and SGImelt are empty,
            # then make a copy of the dimensions of SOLmelt that is filled with zeroes
            if not solHyps.data.empty and soiHyps.data.empty and egiHyps.data.empty:
                soiHyps.data = solHyps.data.copy()
                soiHyps.data[:] = 0.
                egiHyps.data = solHyps.data.copy()
                egiHyps.data[:] = 0.
            
            sol_by_doy = solHyps.data_by_doy()
            sol_by_doy.name = object
            soi_by_doy = soiHyps.data_by_doy()
            soi_by_doy.name = object
            egi_by_doy = egiHyps.data_by_doy()
            egi_by_doy.name = object

            sol = sol.append(sol_by_doy)
            soi = soi.append(soi_by_doy)
            egi = egi.append(egi_by_doy)
            
        print(sol)
        print(soi)
        print(egi)
        
        # Make a new DataFrame with the volumes by date and SOL/SOI/EGI columns
        df = pd.concat([sol.sum(), egi.sum(), soi.sum()], axis=1)
        df.columns = ['SOL_melt_km3', 'EGI_melt_km3', 'SOI_melt_km3']

        print(df)
        # df['Snow_ice_area_km2'] = df.sum(axis=1)
        # df['Full_basin_area_km2'] = full_basin_area
        # df['Full_basin_less_snow_ice_area_km2'] = full_basin_area - df['Snow_ice_area_km2']
        # df['Snowy_basin_area_km2'] = snowy_basin_area
        # df['Snowy_basin_less_snow_ice_area_km2'] = snowy_basin_area - df['Snow_ice_area_km2']

        # Write out the data frame
        #outFile = os.path.join(
        #    "/Users/brodzik/projects/CHARIS/derived_hypsometries/MODSCAG_GF_v09_fromFile_rainfall_less_ET",
        #    "%s.%4d.partition_area.new.txt" % (id, year))
        #print("Outfile will be: %s" % outFile)
        
        #fh = open(outFile, 'w')
        #fh.write("# Major_basin: %s\n" % id)
        #fh.write("# Snowy basins: %s\n" % (", ".join(objects)))
        #fh.write("# Number_of_snowy_basins: %d\n" % (len(objects)))
        #fh.write(str(len(df.columns)) + '\n')
        #fh.write(' '.join([str(col) for col in df.columns]) + '\n')
        #fh.close()
        
        #df['yyyy'] = df.index.year
        #df['mm'] = df.index.month
        #df['dd'] = df.index.day
        #df['doy'] = df.index.dayofyear
        #df = df.reindex_axis(
        #    ['yyyy', 'mm', 'dd', 'doy'] +
        #    list(df.columns[:-4]), axis=1)
        
        #format = "%.4f"                           
        #df.to_csv(outFile, mode='a', header=False, index=False, sep=" ",  
        #          float_format=format, quoting=csv.QUOTE_NONE)


/Users/brodzik/projects/CHARIS/derived_hypsometries/MODSCAG_GF_v09_fromFile_rainv01_less_ET
There are 27 OBJECTID sub-basins for the AM major basin
subbasins for this major basin:
['AM_OBJECTID100', 'AM_OBJECTID62', 'AM_OBJECTID64', 'AM_OBJECTID65', 'AM_OBJECTID66', 'AM_OBJECTID68', 'AM_OBJECTID69', 'AM_OBJECTID72', 'AM_OBJECTID77', 'AM_OBJECTID78', 'AM_OBJECTID79', 'AM_OBJECTID80', 'AM_OBJECTID81', 'AM_OBJECTID82', 'AM_OBJECTID83', 'AM_OBJECTID84', 'AM_OBJECTID85', 'AM_OBJECTID86', 'AM_OBJECTID88', 'AM_OBJECTID89', 'AM_OBJECTID90', 'AM_OBJECTID91', 'AM_OBJECTID93', 'AM_OBJECTID94', 'AM_OBJECTID97', 'AM_OBJECTID98', 'AM_OBJECTID99']
Next objectID: AM_OBJECTID100
Next objectID: AM_OBJECTID62
Next objectID: AM_OBJECTID64
Next objectID: AM_OBJECTID65
Next objectID: AM_OBJECTID66
Next objectID: AM_OBJECTID68
Next objectID: AM_OBJECTID69
Next objectID: AM_OBJECTID72
Next objectID: AM_OBJECTID77
Next objectID: AM_OBJECTID78
Next objectID: AM_OBJECTID79
Next objectID: AM_OBJECTID80
Next objectID: AM_OBJECTID81
Next objectID: AM_OBJECTID82
Next objectID: AM_OBJECTID83
Next objectID: AM_OBJECTID84
Next objectID: AM_OBJECTID85
Next objectID: AM_OBJECTID86
Next objectID: AM_OBJECTID88
Next objectID: AM_OBJECTID89
Next objectID: AM_OBJECTID90
Next objectID: AM_OBJECTID91
Next objectID: AM_OBJECTID93
Next objectID: AM_OBJECTID94
Next objectID: AM_OBJECTID97
Next objectID: AM_OBJECTID98
Next objectID: AM_OBJECTID99
                2001-01-01  2001-01-02  2001-01-03  2001-01-04  2001-01-05  \
AM_OBJECTID100    0.003599    0.002224    0.000000    0.000000    0.002026   
AM_OBJECTID62     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID64     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID65     0.000095    0.000022    0.000000    0.000008    0.000038   
AM_OBJECTID66     0.007082    0.001271    0.000001    0.000371    0.002806   
AM_OBJECTID68     0.000026    0.000004    0.000000    0.000009    0.000015   
AM_OBJECTID69     0.000495    0.000003    0.000000    0.000168    0.000147   
AM_OBJECTID72     0.009565    0.000620    0.000000    0.001793    0.004767   
AM_OBJECTID77     0.005464    0.003475    0.000000    0.000004    0.001096   
AM_OBJECTID78     0.001811    0.001109    0.000000    0.000004    0.000645   
AM_OBJECTID79     0.028521    0.010673    0.000012    0.000486    0.015669   
AM_OBJECTID80     0.010327    0.002011    0.000001    0.000461    0.007119   
AM_OBJECTID81     0.006881    0.000532    0.000000    0.000804    0.004098   
AM_OBJECTID82     0.022961    0.007226    0.000028    0.000673    0.014261   
AM_OBJECTID83     0.000058    0.000030    0.000000    0.000000    0.000000   
AM_OBJECTID84     0.001400    0.000029    0.000000    0.000304    0.000606   
AM_OBJECTID85     0.001952    0.001020    0.000000    0.000000    0.000556   
AM_OBJECTID86     0.000040    0.000020    0.000000    0.000000    0.000000   
AM_OBJECTID88     0.020451    0.002420    0.000021    0.011553    0.010378   
AM_OBJECTID89     0.002243    0.001340    0.000000    0.000000    0.001477   
AM_OBJECTID90     0.007282    0.002413    0.000000    0.000326    0.005280   
AM_OBJECTID91     0.000664    0.000227    0.000000    0.000203    0.000634   
AM_OBJECTID93     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID94     0.001306    0.000666    0.000000    0.000000    0.000674   
AM_OBJECTID97     0.016629    0.007292    0.000009    0.002980    0.015872   
AM_OBJECTID98     0.003638    0.001053    0.000001    0.001441    0.004089   
AM_OBJECTID99     0.014737    0.002119    0.000000    0.006589    0.006874   

                2001-01-06  2001-01-07  2001-01-08  2001-01-09  2001-01-10  \
AM_OBJECTID100    0.000051    0.000000    0.000000    0.000000    0.000104   
AM_OBJECTID62     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID64     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID65     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID66     0.000021    0.000001    0.000003    0.000000    0.000012   
AM_OBJECTID68     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID69     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID72     0.000006    0.000000    0.000002    0.000000    0.000020   
AM_OBJECTID77     0.000058    0.000000    0.000018    0.000000    0.000000   
AM_OBJECTID78     0.000064    0.000000    0.000028    0.000000    0.000000   
AM_OBJECTID79     0.000718    0.000027    0.000188    0.000009    0.000102   
AM_OBJECTID80     0.000132    0.000006    0.000024    0.000001    0.000045   
AM_OBJECTID81     0.000037    0.000001    0.000008    0.000000    0.000027   
AM_OBJECTID82     0.000562    0.000015    0.000105    0.000053    0.000361   
AM_OBJECTID83     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID84     0.000000    0.000000    0.000000    0.000000    0.000001   
AM_OBJECTID85     0.000045    0.000000    0.000000    0.000000    0.000004   
AM_OBJECTID86     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID88     0.000025    0.000000    0.000012    0.000063    0.000673   
AM_OBJECTID89     0.000253    0.000000    0.000001    0.000000    0.000137   
AM_OBJECTID90     0.000121    0.000000    0.000008    0.000000    0.000038   
AM_OBJECTID91     0.000007    0.000000    0.000000    0.000000    0.000025   
AM_OBJECTID93     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID94     0.000038    0.000000    0.000000    0.000000    0.000024   
AM_OBJECTID97     0.000970    0.000001    0.000050    0.000345    0.002169   
AM_OBJECTID98     0.000090    0.000000    0.000005    0.000049    0.000308   
AM_OBJECTID99     0.000069    0.000000    0.000004    0.000087    0.000631   

                   ...      2001-12-22  2001-12-23  2001-12-24  2001-12-25  \
AM_OBJECTID100     ...        0.004296    0.001008    0.000473    0.001345   
AM_OBJECTID62      ...        0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID64      ...        0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID65      ...        0.000000    0.000000    0.000030    0.000146   
AM_OBJECTID66      ...        0.000002    0.000231    0.001349    0.005847   
AM_OBJECTID68      ...        0.000000    0.000000    0.000008    0.000021   
AM_OBJECTID69      ...        0.000008    0.000159    0.000205    0.000920   
AM_OBJECTID72      ...        0.000009    0.000537    0.001869    0.008416   
AM_OBJECTID77      ...        0.001385    0.000655    0.000730    0.001512   
AM_OBJECTID78      ...        0.000937    0.000525    0.000454    0.000782   
AM_OBJECTID79      ...        0.005838    0.004609    0.006632    0.017025   
AM_OBJECTID80      ...        0.000703    0.000909    0.002430    0.008424   
AM_OBJECTID81      ...        0.000052    0.000516    0.001825    0.007442   
AM_OBJECTID82      ...        0.011292    0.005773    0.006847    0.019065   
AM_OBJECTID83      ...        0.000142    0.000000    0.000000    0.000000   
AM_OBJECTID84      ...        0.000024    0.000209    0.000479    0.002043   
AM_OBJECTID85      ...        0.001405    0.000393    0.000153    0.000316   
AM_OBJECTID86      ...        0.000069    0.000000    0.000000    0.000000   
AM_OBJECTID88      ...        0.008387    0.003338    0.003971    0.007884   
AM_OBJECTID89      ...        0.001800    0.000922    0.000651    0.001197   
AM_OBJECTID90      ...        0.001957    0.001439    0.002651    0.007042   
AM_OBJECTID91      ...        0.000874    0.000580    0.000886    0.001592   
AM_OBJECTID93      ...        0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID94      ...        0.001410    0.000359    0.000188    0.000434   
AM_OBJECTID97      ...        0.029121    0.013168    0.014263    0.029221   
AM_OBJECTID98      ...        0.011722    0.005079    0.006687    0.011899   
AM_OBJECTID99      ...        0.018725    0.004621    0.005516    0.007737   

                2001-12-26  2001-12-27  2001-12-28  2001-12-29  2001-12-30  \
AM_OBJECTID100    0.002449    0.000363    0.000648    0.000808    0.006162   
AM_OBJECTID62     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID64     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID65     0.000246    0.000288    0.000166    0.000233    0.000376   
AM_OBJECTID66     0.010891    0.010597    0.005310    0.008395    0.020473   
AM_OBJECTID68     0.000027    0.000027    0.000018    0.000017    0.000017   
AM_OBJECTID69     0.001299    0.001528    0.001232    0.001295    0.001636   
AM_OBJECTID72     0.013414    0.015440    0.010805    0.014506    0.022399   
AM_OBJECTID77     0.005955    0.002168    0.002011    0.001863    0.011689   
AM_OBJECTID78     0.002199    0.000825    0.000753    0.000725    0.002818   
AM_OBJECTID79     0.032575    0.018677    0.012687    0.013855    0.040766   
AM_OBJECTID80     0.013900    0.010600    0.006540    0.008492    0.018989   
AM_OBJECTID81     0.011573    0.011679    0.007830    0.011045    0.019680   
AM_OBJECTID82     0.031630    0.014986    0.012454    0.013317    0.042787   
AM_OBJECTID83     0.000019    0.000000    0.000000    0.000000    0.000065   
AM_OBJECTID84     0.003057    0.003496    0.002774    0.003326    0.004904   
AM_OBJECTID85     0.001395    0.000127    0.000238    0.000203    0.001948   
AM_OBJECTID86     0.000011    0.000000    0.000000    0.000000    0.000041   
AM_OBJECTID88     0.006308    0.007395    0.007311    0.008552    0.016751   
AM_OBJECTID89     0.002107    0.000663    0.000799    0.000806    0.002599   
AM_OBJECTID90     0.010320    0.006944    0.005040    0.005359    0.011002   
AM_OBJECTID91     0.001594    0.001303    0.001069    0.001047    0.001406   
AM_OBJECTID93     0.000000    0.000000    0.000000    0.000000    0.000000   
AM_OBJECTID94     0.001048    0.000145    0.000235    0.000234    0.001851   
AM_OBJECTID97     0.029578    0.019113    0.017782    0.019782    0.042388   
AM_OBJECTID98     0.009250    0.008023    0.007737    0.008986    0.017692   
AM_OBJECTID99     0.003735    0.003933    0.004830    0.006301    0.019761   

                2001-12-31  
AM_OBJECTID100    0.007131  
AM_OBJECTID62     0.000000  
AM_OBJECTID64     0.000000  
AM_OBJECTID65     0.000157  
AM_OBJECTID66     0.008808  
AM_OBJECTID68     0.000005  
AM_OBJECTID69     0.000863  
AM_OBJECTID72     0.010868  
AM_OBJECTID77     0.011733  
AM_OBJECTID78     0.002473  
AM_OBJECTID79     0.032872  
AM_OBJECTID80     0.013680  
AM_OBJECTID81     0.010793  
AM_OBJECTID82     0.039787  
AM_OBJECTID83     0.000044  
AM_OBJECTID84     0.002736  
AM_OBJECTID85     0.001604  
AM_OBJECTID86     0.000029  
AM_OBJECTID88     0.014151  
AM_OBJECTID89     0.002513  
AM_OBJECTID90     0.009812  
AM_OBJECTID91     0.001347  
AM_OBJECTID93     0.000000  
AM_OBJECTID94     0.001842  
AM_OBJECTID97     0.044615  
AM_OBJECTID98     0.018476  
AM_OBJECTID99     0.017353  

[27 rows x 365 columns]
                2001-01-01  2001-01-02  2001-01-03  2001-01-04  2001-01-05  \
AM_OBJECTID100         0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID62          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID64          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID65          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID66          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID68          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID69          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID72          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID77          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID78          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID79          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID80          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID81          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID82          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID83          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID84          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID85          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID86          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID88          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID89          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID90          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID91          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID93          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID94          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID97          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID98          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID99          0.0         0.0         0.0         0.0         0.0   

                2001-01-06  2001-01-07  2001-01-08  2001-01-09  2001-01-10  \
AM_OBJECTID100         0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID62          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID64          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID65          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID66          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID68          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID69          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID72          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID77          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID78          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID79          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID80          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID81          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID82          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID83          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID84          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID85          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID86          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID88          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID89          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID90          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID91          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID93          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID94          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID97          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID98          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID99          0.0         0.0         0.0         0.0         0.0   

                   ...      2001-12-22  2001-12-23  2001-12-24  2001-12-25  \
AM_OBJECTID100     ...             0.0         0.0         0.0         0.0   
AM_OBJECTID62      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID64      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID65      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID66      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID68      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID69      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID72      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID77      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID78      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID79      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID80      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID81      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID82      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID83      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID84      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID85      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID86      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID88      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID89      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID90      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID91      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID93      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID94      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID97      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID98      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID99      ...             0.0         0.0         0.0         0.0   

                2001-12-26  2001-12-27  2001-12-28  2001-12-29  2001-12-30  \
AM_OBJECTID100         0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID62          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID64          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID65          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID66          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID68          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID69          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID72          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID77          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID78          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID79          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID80          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID81          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID82          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID83          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID84          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID85          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID86          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID88          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID89          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID90          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID91          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID93          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID94          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID97          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID98          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID99          0.0         0.0         0.0         0.0         0.0   

                2001-12-31  
AM_OBJECTID100         0.0  
AM_OBJECTID62          0.0  
AM_OBJECTID64          0.0  
AM_OBJECTID65          0.0  
AM_OBJECTID66          0.0  
AM_OBJECTID68          0.0  
AM_OBJECTID69          0.0  
AM_OBJECTID72          0.0  
AM_OBJECTID77          0.0  
AM_OBJECTID78          0.0  
AM_OBJECTID79          0.0  
AM_OBJECTID80          0.0  
AM_OBJECTID81          0.0  
AM_OBJECTID82          0.0  
AM_OBJECTID83          0.0  
AM_OBJECTID84          0.0  
AM_OBJECTID85          0.0  
AM_OBJECTID86          0.0  
AM_OBJECTID88          0.0  
AM_OBJECTID89          0.0  
AM_OBJECTID90          0.0  
AM_OBJECTID91          0.0  
AM_OBJECTID93          0.0  
AM_OBJECTID94          0.0  
AM_OBJECTID97          0.0  
AM_OBJECTID98          0.0  
AM_OBJECTID99          0.0  

[27 rows x 365 columns]
                2001-01-01  2001-01-02  2001-01-03  2001-01-04  2001-01-05  \
AM_OBJECTID100         0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID62          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID64          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID65          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID66          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID68          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID69          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID72          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID77          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID78          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID79          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID80          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID81          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID82          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID83          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID84          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID85          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID86          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID88          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID89          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID90          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID91          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID93          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID94          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID97          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID98          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID99          0.0         0.0         0.0         0.0         0.0   

                2001-01-06  2001-01-07  2001-01-08  2001-01-09  2001-01-10  \
AM_OBJECTID100         0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID62          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID64          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID65          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID66          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID68          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID69          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID72          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID77          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID78          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID79          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID80          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID81          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID82          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID83          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID84          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID85          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID86          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID88          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID89          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID90          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID91          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID93          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID94          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID97          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID98          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID99          0.0         0.0         0.0         0.0         0.0   

                   ...      2001-12-22  2001-12-23  2001-12-24  2001-12-25  \
AM_OBJECTID100     ...             0.0         0.0         0.0         0.0   
AM_OBJECTID62      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID64      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID65      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID66      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID68      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID69      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID72      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID77      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID78      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID79      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID80      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID81      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID82      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID83      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID84      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID85      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID86      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID88      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID89      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID90      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID91      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID93      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID94      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID97      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID98      ...             0.0         0.0         0.0         0.0   
AM_OBJECTID99      ...             0.0         0.0         0.0         0.0   

                2001-12-26  2001-12-27  2001-12-28  2001-12-29  2001-12-30  \
AM_OBJECTID100         0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID62          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID64          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID65          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID66          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID68          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID69          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID72          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID77          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID78          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID79          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID80          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID81          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID82          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID83          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID84          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID85          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID86          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID88          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID89          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID90          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID91          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID93          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID94          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID97          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID98          0.0         0.0         0.0         0.0         0.0   
AM_OBJECTID99          0.0         0.0         0.0         0.0         0.0   

                2001-12-31  
AM_OBJECTID100         0.0  
AM_OBJECTID62          0.0  
AM_OBJECTID64          0.0  
AM_OBJECTID65          0.0  
AM_OBJECTID66          0.0  
AM_OBJECTID68          0.0  
AM_OBJECTID69          0.0  
AM_OBJECTID72          0.0  
AM_OBJECTID77          0.0  
AM_OBJECTID78          0.0  
AM_OBJECTID79          0.0  
AM_OBJECTID80          0.0  
AM_OBJECTID81          0.0  
AM_OBJECTID82          0.0  
AM_OBJECTID83          0.0  
AM_OBJECTID84          0.0  
AM_OBJECTID85          0.0  
AM_OBJECTID86          0.0  
AM_OBJECTID88          0.0  
AM_OBJECTID89          0.0  
AM_OBJECTID90          0.0  
AM_OBJECTID91          0.0  
AM_OBJECTID93          0.0  
AM_OBJECTID94          0.0  
AM_OBJECTID97          0.0  
AM_OBJECTID98          0.0  
AM_OBJECTID99          0.0  

[27 rows x 365 columns]
            SOL_melt_km3  EGI_melt_km3  SOI_melt_km3
2001-01-01      0.167227           0.0      0.000000
2001-01-02      0.047799           0.0      0.000000
2001-01-03      0.000073           0.0      0.000000
2001-01-04      0.028177           0.0      0.000000
2001-01-05      0.099127           0.0      0.000000
2001-01-06      0.003267           0.0      0.000000
2001-01-07      0.000051           0.0      0.000000
2001-01-08      0.000456           0.0      0.000000
2001-01-09      0.000607           0.0      0.000000
2001-01-10      0.004681           0.0      0.000000
2001-01-11      0.174167           0.0      0.000000
2001-01-12      0.102112           0.0      0.000000
2001-01-13      0.056931           0.0      0.000000
2001-01-14      0.026849           0.0      0.000000
2001-01-15      0.051215           0.0      0.000000
2001-01-16      0.000188           0.0      0.000000
2001-01-17      0.000015           0.0      0.000000
2001-01-18      0.005951           0.0      0.000000
2001-01-19      0.013007           0.0      0.000000
2001-01-20      0.006333           0.0      0.000000
2001-01-21      0.000000           0.0      0.000000
2001-01-22      0.000000           0.0      0.000000
2001-01-23      0.000000           0.0      0.000000
2001-01-24      0.000000           0.0      0.000000
2001-01-25      0.000000           0.0      0.000000
2001-01-26      0.000000           0.0      0.000000
2001-01-27      0.000016           0.0      0.000000
2001-01-28      0.023283           0.0      0.000000
2001-01-29      0.001983           0.0      0.000000
2001-01-30      0.008142           0.0      0.000000
...                  ...           ...           ...
2001-12-02      0.014684           0.0      0.000000
2001-12-03      0.003206           0.0      0.000000
2001-12-04      0.003669           0.0      0.000000
2001-12-05      0.154730           0.0      0.000000
2001-12-06      0.126037           0.0      0.000000
2001-12-07      0.029051           0.0      0.000000
2001-12-08      0.005044           0.0      0.000000
2001-12-09      0.005467           0.0      0.000000
2001-12-10      0.000001           0.0      0.000000
2001-12-11      0.000275           0.0      0.000000
2001-12-12      0.045657           0.0      0.000000
2001-12-13      0.020990           0.0      0.000000
2001-12-14      0.038082           0.0      0.000000
2001-12-15      0.092158           0.0      0.000000
2001-12-16      0.141481           0.0      0.000000
2001-12-17      0.063134           0.0      0.000000
2001-12-18      0.002091           0.0      0.000000
2001-12-19      0.268755           0.0      0.000000
2001-12-20      0.611674           0.0      0.000004
2001-12-21      0.516793           0.0      0.000000
2001-12-22      0.100158           0.0      0.000000
2001-12-23      0.045030           0.0      0.000000
2001-12-24      0.058297           0.0      0.000000
2001-12-25      0.140310           0.0      0.000000
2001-12-26      0.194580           0.0      0.000000
2001-12-27      0.138320           0.0      0.000000
2001-12-28      0.108269           0.0      0.000000
2001-12-29      0.129147           0.0      0.000000
2001-12-30      0.308200           0.0      0.000000
2001-12-31      0.253692           0.0      0.000000

[365 rows x 3 columns]

In [ ]:
%cat /Users/brodzik/projects/CHARIS/derived_hypsometries/MODSCAG_GF_v09_fromFile_rainfall_less_ET/SY_v01.2001.partition_area.txt

In [ ]:
fig, axes = plt.subplots(1)
for id in majorBasinIDs:
    outFile = myEnv.hypsometry_filename(type='area_by_elevation', drainageID=id)
    print(outFile)
    hyps = Hypsometry(outFile)
    hyps.data.loc['NoDate'].plot(label=id)
    axes.legend()

In [ ]:
fig, axes = plt.subplots(1)
for id in majorBasinIDs:
    outFile = myEnv.hypsometry_filename(type='area_by_elevation', drainageID=id)
    print(outFile)
    hyps = Hypsometry(outFile)
    hyps.data.loc['NoDate'].plot(label=id)
    axes.legend()

In [ ]:
#hyps.data

In [ ]: